<template>
  <div id="comments">
  <div class="list-block media-list">
      <ul>
        <li v-for="topic in topics" style="border-bottom: dotted 1px rgb(16, 197, 182);">
            <div class="item-content">
            <div class="item-media"><img src="http://ww2.sinaimg.cn/mw690/6f767da7jw1eijbwtal71j20l30v9djn.jpg" style='width: 2.2rem;height: 2.2rem;'></div>
            <div class="item-inner">
                <div class="userProfile">
                    <div class="item-title-row">
                    <div class="item-title">飞雷</div>
                    </div>
                    <div class="item-subtitle" style="font-size: 0.75rem;">2小时前</div>
                </div>
                <div class="userSchool">青岛科技大学</div>
            </div>
            </div>
            <div class="">
                <div class="card-content">
                  <div class="card-content-inner">{{topic.content}}</div>
                  <div v-if="topic.img != ''" class="card-content">
                    <img style="height: 150px;" src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1498367451471&di=942d2cfc278a85736640498af85b25c9&imgtype=0&src=http%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz%2FCxZ8gu2EQibVthRLT2ZiaeWYxic0O86HYx8MRaFPpUHmO5EWGuyABPrLPs6W3BUEP2dXNz42qicL74VhSeLeV70AsA%2F640" width="100%">
                  </div>
                </div>
            </div>
            <div style="height: 30px; margin-top:0">
              <div slot="content" class="card-padding" style="text-align:right;hight:20px">
                <router-link to="/home/comments" class="h-write-point">
                  <span style="font-size:18px;color: rgb(16, 197, 182);margin-right: 30px;height: 20px;display: block;float: right;">
                    2
                  </span>
                  <span @click="clickComment" style="margin-right: 5px;height: 20px;display: block;float: right;">
                    <icon style="color: #10c5b6" name="comments-o" scale="1.5"></icon>
                  </span>
                </router-link>
                <span @click="clickLike" style="font-size:18px;color: rgb(16, 197, 182);margin-right: 30px;height: 20px;display: block;float: right;">
                  34
                </span>
                <span @click="clickLike" style="margin-right: 5px;height: 20px;display: block;float: right;">
                  <icon style="color: #10c5b6" name="thumbs-o-up" scale="1.5"></icon>
                </span>
              </div>
            </div>
        </li>
      </ul>
    </div>
    <div>回复列表</div>
  </div>
</template>

<script>

let topics = [
  {
    content: '坚持自己那一亩三分地',
    img: ''
  }
]

import { Grid, XHeader } from 'vux'

export default {
  components: {
    Grid,
    XHeader
  },
  mounted () {
    if (this.$router.history.current.path === '/home') {
      this.$router.push('home')
      console.log('路径是一个home')
    }
    this.topics = topics
    console.log(this.$router)
    console.log(this.$router.history.current.path)
  },
  data () {
    return {
      items: [],
      topics: []
    }
  },
  methods: {
    refresh: function (done) {
    }
  }
}
</script>

<style lang="less" scoped>
@import '~vux/src/styles/1px.less';
@import '~vux/src/styles/center.less';

.box {
  padding: 15px;
}
.active-6-1 {
  color: rgb(252, 55, 140) !important;
  border-color: rgb(252, 55, 140) !important;
}
.active-6-2 {
  color: #04be02 !important;
  border-color: #04be02 !important;
}
.active-6-3 {
  color: rgb(55, 174, 252) !important;
  border-color: rgb(55, 174, 252) !important;
}
.tab-swiper {
  background-color: #fff;
  height: 100px;
}

.vux-tab .vux-tab-item.vux-tab-selected{
    color: #10c5b6;
    border-bottom: 5px solid #10c5b6;
}

.vux-tab-bar-inner {
    display: block;
    background-color: #10c5b6 !important;
    margin: auto;
    height: 100%;
    -webkit-transition: width 0.3s cubic-bezier(0.35, 0, 0.25, 1);
    transition: width 0.3s cubic-bezier(0.35, 0, 0.25, 1);
}
.m-img {
  padding-bottom: 33%;
  display: block;
  position: relative;
  max-width: 100%;
  background-size: cover;
  background-position: center center;
  cursor: pointer;
  border-radius: 2px;
}

.m-title {
  color: #fff;
  text-align: center;
  text-shadow: 0 0 2px rgba(0, 0, 0, .5);
  font-weight: 500;
  font-size: 16px;
  position: absolute;
  left: 0;
  right: 0;
  width: 100%;
  text-align: center;
  top: 50%;
  transform: translateY(-50%);
}

.m-time {
  font-size: 12px;
  padding-top: 4px;
  border-top: 1px solid #f0f0f0;
  display: inline-block;
  margin-top: 5px;
}

.list-block {
    margin: 0.75rem 0;
    font-size: 0.85rem;
}
.list-block ul {
    background: #fff;
    list-style: none;
    padding: 0;
    margin: 0;
    position: relative;
}
.list-block li {
    box-sizing: border-box;
    position: relative;
}
.list-block .item-content {
    box-sizing: border-box;
    padding-left: 0.75rem;
    min-height: 2.2rem;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-pack: justify;
    -webkit-justify-content: space-between;
    justify-content: space-between;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
}
.list-block.media-list .item-media {
    padding-top: 0.45rem;
    padding-bottom: 0.5rem;
}
.list-block .item-media {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-shrink: 0;
    -ms-flex: 0 0 auto;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
    -webkit-box-lines: single;
    -moz-box-lines: single;
    -webkit-flex-wrap: nowrap;
    flex-wrap: nowrap;
    box-sizing: border-box;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    padding-top: 0.35rem;
    padding-bottom: 0.4rem;
}
.list-block.media-list .item-media img {
    display: block;
}
.list-block.media-list .item-inner {
    display: block;
    padding-top: 0.5rem;
    padding-bottom: 0.45rem;
    -webkit-align-self: stretch;
    align-self: stretch;
}

.list-block .item-media + .item-inner {
    margin-left: 0.75rem;
}

.list-block .item-inner {
    padding-right: 0.75rem;
    position: relative;
    width: 100%;
    padding-top: 0.4rem;
    padding-bottom: 0.35rem;
    min-height: 2.2rem;
    overflow: hidden;
    box-sizing: border-box;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-flex: 1;
    -ms-flex: 1;
    -webkit-box-pack: justify;
    -webkit-justify-content: space-between;
    justify-content: space-between;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
}
.userProfile {
    float: left;
    line-height: 1.1rem;
    font-size: 0.75rem;
    font-family: "Microsoft Yahei", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.list-block.media-list .item-title-row {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-pack: justify;
    -webkit-justify-content: space-between;
    justify-content: space-between;
}
.list-block.media-list .item-title {
    font-weight: 500;
}
.list-block .item-subtitle {
    font-size: 0.75rem;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    max-width: 100%;
    text-overflow: ellipsis;
}
.userSchool {
    line-height: 2.2rem;
    float: right;
    font-size: 0.75rem;
    font-family: "Microsoft Yahei", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.card-content-inner{
  margin-left:10px;
}
.follow{
  color: #ff8989;
  border-color: #ff8989;
  border-radius: 4px;
  border: 1px solid;
  width: 80px;
  margin: 0 auto;
}
.h-write-point{
  color: #666;
}
</style>

